package cn.wit.luohui.day05;

public class Sum {
	 public static void main(String[] args) {
		 
		    sumDigits (1234);
		   
		  }
		  
		  public static int sumDigits(long n) {
			  
			  int sum=0;
			 
			 while (n != 0) {
			  
		          int a=(int)(n%10);
		           sum+=a;
		          n = n / 10;
		         
		       
			 }  
			    System.out.println(sum);

		  return 0;
}
}
